import { NextResponse } from 'next/server';

export async function redirectMiddleware(request: Request, next: () => Promise<NextResponse>): Promise<NextResponse> {
  console.log('Redirect Middleware:', request.url);
  // 实现你的重定向逻辑
  if (request.url.includes('/')) {
    // return NextResponse.redirect('https://www.baidu.com');
  }
  return next();
}

export const redirectMatcher = ['/api/redirect/:path*'];
